home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / util / libs / queue.lzh / queue_2.0 / queue_library.h < prev    next >
C/C++ Source or Header  |  1996-09-09  |  2KB  |  70 lines

  1. /*
  2.    queue_library.h --- queue library internals.
  3.  
  4.    Copyright (c) 1995 SHW Wabnitz
  5.    Written by Bernhard Fastenrath (fasten@shw.com)
  6.  
  7.    This file may be distributed under the terms
  8.    of the GNU General Public License.
  9. */
  10.  
  11. #include <exec/types.h>
  12. #include <exec/lists.h>
  13. #include <exec/nodes.h>
  14. #include <exec/memory.h>
  15. #include <dos/dos.h>
  16. #include <dos/dosextens.h>
  17. #include <dos/filehandler.h>
  18.  
  19. #include <proto/exec.h>
  20. #include <proto/dos.h>
  21.  
  22. #include <stdlib.h>
  23. #include <string.h>
  24.  
  25. #include "queue.h"
  26.  
  27. typedef struct List List;
  28. typedef struct Node Node;
  29. typedef struct MinNode MinNode;
  30. typedef struct MsgPort MsgPort;
  31. typedef struct Message Message;
  32. typedef struct SignalSemaphore Semaphore;
  33. typedef struct Task Task;
  34.  
  35. typedef struct {
  36.   Node        qn_Node;
  37.   List        qn_List;
  38.   ULONG        qn_Refs;
  39.   ULONG        qn_Read;
  40.   List        qn_Handles;
  41.   Semaphore    qn_Semaphore;
  42. } QueueNode;
  43.  
  44. /* bitmasks for qm_Status */
  45. #define QMS_ACTIVE   0x01
  46. #define QMS_INACTIVE 0x02
  47. #define QMS_REMOVED ( QMS_INACTIVE | 0x04 )
  48. #define QMS_MARKER  ( QMS_INACTIVE | 0x08 )
  49.  
  50. typedef struct {
  51.   MinNode       qh_MinNode;
  52.   USHORT        qh_Mode;
  53.   USHORT        qh_Pad;
  54.   QueueNode    *qh_QNode;
  55.   ULONG        qh_SigMask;
  56.   Task         *qh_SigTask;
  57.   union {
  58.     struct {
  59.       QMessage *qhl_Message;
  60.       MinNode   qhl_MinNode; /* same as qm_MinNode */
  61.       USHORT    qhl_Status;  /* same as qm_Status  */
  62.       USHORT    qhl_Pad;
  63.     } qhl;
  64.     struct {
  65.       List    qhs_ReplyList;
  66.       ULONG    qhs_MsgCount;
  67.     } qhs;
  68.   } qh_un;
  69. } QueueHandle;
  70.